package code;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;

public class AsymmetricKeyMaker {
	public String algorithm;
	private PublicKey publickey;
	private PrivateKey privatekey;
	
	public AsymmetricKeyMaker(String algorithm){
		this.algorithm=algorithm;
	}
    public void generateKey(){
    	try{
    	KeyPair keyPair = KeyPairGenerator.getInstance(algorithm).generateKeyPair();
    	publickey= keyPair.getPublic();
    	privatekey= keyPair.getPrivate();
    	}catch(Exception exception){
    		exception.printStackTrace();
    	}
 }
	public PrivateKey getPrivatekey() {
		return privatekey;
	}
	public PublicKey getPublickey() {
		return publickey;
	}
}